/**
 * Copyright &copy; 2018-2018 <a href="#">聚成科技</a> All rights reserved.
 */
package com.jckj.core.service.impl;

import com.jckj.core.dao.SysAttachmentMapper;
import com.jckj.core.entity.SysAttachment;
import com.jckj.core.exception.ServiceException;
import com.jckj.core.service.SysAttachmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * </p>
 *
 * @author 刘志远
 * @date 18-1-23
 */

@Service
@Transactional(readOnly = true, rollbackFor = ServiceException.class)
public class SysAttachmentServiceImpl implements SysAttachmentService{

    @Autowired
    SysAttachmentMapper sysAttachmentMapper;

    @Override
    @Transactional(readOnly = false, rollbackFor = ServiceException.class)
    public int insert(SysAttachment sysAttachment) throws ServiceException {
        int effectCount = 0;
        try{
            effectCount = sysAttachmentMapper.insert(sysAttachment);
        }catch(Exception ex){
            throw new ServiceException(ex);
        }
        return effectCount;
    }
}
